import com.lyx.server.util.DateUtils;
import org.junit.jupiter.api.Test;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

/**
 * --- Be Humble and Hungry ---
 *
 * @author McMeloxD
 * @date 2024/8/15
 * @desc
 */
public class test {

    @Test
    public void test() throws ParseException {
        String str1="2024-8-14 15:12:00";
        Calendar calendar = Calendar.getInstance();
        calendar.add(Calendar.DAY_OF_MONTH,-1);
        Date date = new Date();
        System.out.println(DateUtils.isSameDay(calendar.getTime(),new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(str1)));
    }
}
